package cn.iphone.NPlayer.fallback;

import cn.iphone.NPlayer.CourseDoc;
import cn.iphone.NPlayer.fegin.CourseEsService;
import cn.iphone.NPlayer.result.JSONResult;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author 熔断
 */
@Component
@Slf4j
public class CourseEsServiceFallbackFactory implements FallbackFactory<CourseEsService> {

    @Override
    public CourseEsService create(Throwable throwable) {
        return new CourseEsService() {
            @Override
            public JSONResult saveCourseEs(CourseDoc courseDoc) {
                return JSONResult.error();
            }

            @Override
            public JSONResult offLineCourse(Long courseId) {
                return JSONResult.error();
            }


        };
    }
}
